﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;

namespace BusinessLibrary.BLL
{
    public class Enseignant
    {

        public int Id { get; set; }
        public string Nom { get; set; }
        public string Prenom { get; set; }
        public int Cin { get; set; }
        public string Num_tel { get; set; }
        public string Email { get; set; }
        public DateTime Date_nais { get; set; }
        public string Lieu_nais { get; set; }
        public string Nationalite { get; set; }
        public string Diplome { get; set; }
        public int Grade { get; set; }
        public int Nbr_heure_cours { get; set; }
        public int Nbr_heure_tp { get; set; }
        public string Sex { get; set; }
        public int Score { get; set; }

        public Pays pays { get; set; }
        public Gouvernorat gouvernorat { get; set; }
        public Ville ville { get; set; }
        public Authentification authentification { get; set; }
        public Specialite specialite { get; set; }
        public Departement departement { get; set; }




        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Enseignant GetEnseignantById(int id)
        {
            return sqlEnseignant.GetEnseignantById(id);
        }


        public static int deleteEnseignant(int id, int idAuthent)
        {
            return sqlEnseignant.deletEnseignant(id, idAuthent);
        }


        public static int SaveEnseignant(Enseignant e)
        {
            int nbRow;
            if ((nbRow = sqlEnseignant.updateEnseignant(e)) > 0)
                return nbRow;
            else
                return sqlEnseignant.insertEnseignant(e);
        }
    }

}